
/*
 * (C)opyright 2010, Alessandro Agosto. All rights reserved.
 * This file is part of the "pycoev" project.
 * To get more informations about the license read the LICENSE file.
 *
 * LoopType methods prototypes. Included only by pyc_loop.c
 */


#pragma once
#ifndef _PYC_LOOP_METHODS_H
#define _PYC_LOOP_METHODS_H


PyObject *PycLoop_Add(Loop *, PyObject *, PyObject *);
PyDoc_STRVAR(PycLoop_Add_Doc, "Loop.add(fd, events, timeout, callback, cb_arg)"
                              " -> True/False."                            CRLF
                              "Requires keywords arguments."               CRLF
                              "Says to the loop to control for 'events' on "
                              "'fd', sets the 'timeout' and a 'callback' "
                              "function. Optional argument is 'cb_arg' that "
                              "represents the argument to pass to 'callback'"
                              " when is called."                           CRLF
                              "'callback' must accept three positional "
                              "arguments, the first is a socket (server "
                              "socket), the second represents the event "
                              "that called the callback, you could do some" 
                              "checking about it."                         CRLF
                              "The last is required only if you passed a "
                              "callback argument.");

PyObject *PycLoop_Delete(Loop *, PyObject *);
PyDoc_STRVAR(PycLoop_Delete_Doc, "Loop.delete(fd) -> True/False"              CRLF
                                 "Positional argument."                    CRLF
                                 "Unregisters 'fd' from the event Loop.");

PyObject *PycLoop_LoopOnce(Loop *, PyObject *);
PyDoc_STRVAR(PycLoop_LoopOnce_Doc, "Loop.loop_once(max_wait) -> True/False"CRLF
                                   "Positional argument."                  CRLF
                                   "Loop once.");

PyObject *PycLoop_SetTimeout(Loop *, PyObject *);
PyDoc_STRVAR(PycLoop_SetTimeout_Doc, "Loop.set_timeout(fd, new_timeout)"
                                     "-> None"                             CRLF
                                     "Positional arguments."               CRLF
                                     "Updates the timeout for 'fd' with "
                                     "'new_timeout'.");

PyObject *PycLoop_Loop(Loop *self, PyObject *args);
PyDoc_STRVAR(PycLoop_Loop_Doc, "Loop.loop(max_wait) -> None"               CRLF
                               "A shortcut for Loop.loop_once, loops "
                               "internally with a while 1");


#endif /* _PYC_LOOP_METHODS_H */
